<template>
  <div class="add-enterprise">
    <header class="add-header">
      <div class="left">
        <span
          class="arrow"
          @click="$router.back()"
        ><i class="el-icon-arrow-left" />返回</span>
        <span>|</span>
        <span>添加月卡</span>
      </div>
      <div class="right">黑马程序员</div>
    </header>
    <main class="add-main">
      <div class="form-container">
        <div class="title">车辆信息</div>
        <div class="form">
          <el-form
            ref="ruleForm"
            label-width="100px"
            :model="addForm"
            :rules="rules"
          >
            <el-form-item label="车主姓名" prop="personName">
              <el-input v-model="addForm.personName" />
            </el-form-item>
            <el-form-item label="车牌号码" prop="carNumber">
              <el-input v-model="addForm.carNumber" />
            </el-form-item>
            <el-form-item label="手机号码" prop="phoneNumber">
              <el-input v-model="addForm.phoneNumber" />
            </el-form-item>
            <el-form-item label="车辆品牌" prop="carBrand">
              <el-input v-model="addForm.carBrand" />
            </el-form-item>

          </el-form>
        </div>
      </div>
    </main>
    <main class="add-main">
      <div class="form-container">
        <div class="title">最近一次缴费信息</div>
        <div class="form">
          <el-form
            ref="ruleForm"
            label-width="100px"
            :model="addForm"
            :rules="rules"
          >
            <el-form-item label="有效日期" prop="">
              <el-input v-model="addForm.personName" />
            </el-form-item>
            <el-form-item label="支付金额" prop="paymentAmount">
              <el-input v-model="addForm.paymentAmount" />
            </el-form-item>
            <el-form-item label="支付方式" prop="paymentMethod">
              <el-option
                v-for="item in paymentMethodList"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              />
            </el-form-item>
          </el-form>
        </div>
      </div>
    </main>

    <footer class="add-footer">
      <div class="btn-container">
        <el-button>重置</el-button>
        <el-button type="primary">确定</el-button>
      </div>
    </footer>
  </div>
</template>

<script>

export default {
  data() {
    return {
      addForm: [
        {
          personName: '',
          phoneNumber: '',
          carNumber: '',
          carBrand: '',
          cardStartDate: '',
          cardEndDate: '',
          paymentAmount: '',
          paymentMethod: ''
        }
      ],
      rules: {
        personName: [{ required: true, message: '请输入车主姓名', trigger: 'blur' }],
        carNumber: [
          { required: true, message: '请输入车牌号码', trigger: 'blur' }
        ],
        phoneNumber: [
          { required: true, message: '请输入手机号码', trigger: 'blur' }
        ],
        carBrand: [
          { required: true, message: '请输入车辆品牌', trigger: 'blur' }
        ]
      },
      paymentMethodList: [
        { value: 'Alipay', label: '支付宝' },
        { value: 'WeChat', label: '微信' },
        { value: 'Cash', label: '现金' }
      ]
    }
  }

}
</script>

<style scoped lang="scss">
.add-enterprise {
  background-color: #f4f6f8;
  height: 100vh;

  .add-header {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    height: 64px;
    line-height: 64px;
    font-size: 16px;
    font-weight: bold;
    background-color: #fff;

    .left {
      span {
        margin-right: 4px;
      }
      .arrow {
        cursor: pointer;
      }
    }

    .right {
      text-align: right;
    }
  }

  .add-main {
    background: #f4f6f8;
    padding: 20px 130px;

    .form-container {
      background-color: #fff;
      .title {
        height: 60px;
        line-height: 60px;
        padding-left: 20px;
      }
      .form {
        margin-bottom: 20px;
        padding: 20px 65px 24px;
        .el-form {
          display: flex;
          flex-wrap: wrap;
          .el-form-item {
            width: 50%;
          }
        }
      }
    }
  }

  .add-footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 24px 50px;
    color: #000000d9;
    font-size: 14px;
    background: #fff;
    text-align: center;
  }
}
</style>
